@echo off
if "%1"/ == ""/ exit
if "%ROOT_BATCH%"/ == ""/ %1\_start go %0 %1 %2 %3

set PATH=%1;%PATH%
set COM_PORT=%3
if "%3"/ == ""/ call set_port

if "%COM_PORT%"/ == ""/ goto try_get_port
goto exec

:try_get_port
4getport_ft
set port_num=%errorlevel%
if %port_num%/ == 0/ goto end
set COM_PORT=COM%port_num%

:exec
call %1\_run %2 < %1\_n.txt
goto exit

:end
echo.
echo    *****   ****    ****     ***    ****
echo    *       *   *   *   *   *   *   *   *
echo    ***     ****    ****    *   *   ****
echo    *       *  *    *  *    *   *   *  *
echo    *****   *   *   *   *    ***    *   *
echo.

:exit
if exist "%1\ftlib.log" del "%1\ftlib.log"
if exist "%1\ftlib.bak" del "%1\ftlib.bak"
if exist "ftlib.log" del "ftlib.log"
if exist "ftlib.bak" del "ftlib.bak"
